@extends("layouts.app",['categories'=>get_categoires_all()])

@section('title','个人中心')

@section('content')
    <div class="row">
        <div class="col-md-3">
            <div class="card" style="width: 18rem;">
                <img src="{{get_user_avatar($user->avatar)}}" class="card-img-top" alt="avatar">

                <ul class="list-group list-group-flush">
                    <li class="list-group-item"><i class="fa-regular fa-user"></i>
                        <span class=" text-success"><b>用户名 ：</b>{{$user->name}}</span></li>
                    <li class="list-group-item"><i class="fa-regular fa-envelope"></i>
                        <span class=" text-success"><b>邮箱 ：</b>{{$user->email}}</span></li>
                    <li class="list-group-item"><i class="fa-regular fa-calendar"></i>
                        <span class=" text-success"><b>注册时间 ：</b>{{$user->created_at->diffForHumans()}}</span></li>
                </ul>

                <div class="card-footer">
                    <h5 class="card-title">个人签名</h5>
                    <p class="card-text">{{$user->info}}</p>
                </div>
            </div>

        </div>
        <div class="col-md-9">
            {{--未编辑信息--}}
            <div class="card mb-4">
                <div class="card-header">
                    Quote
                </div>
                <div class="card-body">
                    <blockquote class="blockquote mb-0">
                        <p>A well-known quote, contained in a blockquote element.</p>
                        <footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
                    </blockquote>
                </div>
            </div>

            {{--足迹--}}
            <div class="card">
                <div class="card-body">
                    <div class="card-header bg-transparent nav_topic">
                        <ul class="nav nav-tabs">
                            <li class="nav-item">
                                <a class="nav-link {{active_class(if_query('tab',null))}}" aria-current="page" href="{{route('users.show',[$user->id])}}">他的帖子</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link {{active_class(if_query('tab','reply'))}}" href="{{route('users.show',[$user->id,'tab'=>'reply'])}}">他的评论</a>
                            </li>
                        </ul>
                    </div>

                    @if(if_query('tab','reply'))
                        {{--评论列表--}}
                        @include('users._reply_list',['replies'=>$user->replies()->with('topic')->recent()->paginate(10)])
                    @else
                        {{--帖子列表--}}
                        @include('users._topic_list',['topics'=>$user->topics()->recent()->paginate(5)])
                    @endif

                </div>
            </div>
        </div>

    </div>



@stop
